const axios = require('axios');

const [username, password] = process.argv.slice(2);

if (!username || !password) {
  console.log('使用方法: node clientPost.js 用户名 密码');
  process.exit(1);
}

axios.post('http://localhost:8081/login', {
  username,
  password
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error('登录失败:', error.response?.data || error.message);
});